#@layout()

#define checked(e)
    #if(e == "wj" && solved == 0) class="layui-this"
    #elseif(e == "yj" && solved == 1) class="layui-this"
    #elseif(e == "jh" && wonderful == 1) class="layui-this"
    #elseif(e == "zh" && solved == -1 && wonderful == -1) class="layui-this"
    #end
#end

#define main()
#@flyColumn()
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="fly-panel" style="margin-bottom: 0;">
                <div class="fly-panel-title fly-filter">
                    <a href="?" #@checked('zh')>综合</a>
                    <span class="fly-mid"></span>
                    <a href="?solved=0" #@checked('wj')>未结</a>
                    <span class="fly-mid"></span>
                    <a href="?solved=1" #@checked('yj')>已结</a>
                    <span class="fly-mid"></span>
                    <a href="?wonderful=1" #@checked('jh')>精华</a>
                    <span class="fly-filter-right layui-hide-xs">
            <a href="" class="layui-this">按最新</a>
            <span class="fly-mid"></span>
            <a href="">按热议</a>
            </span>
                </div>

                <ul class="fly-list">
                    #for(x : contents.rows)
                    <li>

                        <a href="/user/#(x.userid)" class="fly-avatar">
                            <img src="#(x.avatar??)" alt="#(x.nickname)">
                        </a>
                        <h2>
                            #if(x.status == 30)
                            <a class="layui-badge">私密</a>
                            #else
                            <a class="layui-badge">#(x.typename)</a>
                            #end
                            <a href="/jie/detail/#(x.contentid)" title="#(x.title)">#(x.title)</a>
                        </h2>
                        <div class="fly-list-info">
                            <a href="/user/#(x.userid)" link>
                                <cite>#(x.nickname)</cite>
                                <!--
                                <i class="iconfont icon-renzheng" title="认证信息：XXX"></i>
                                <i class="layui-badge fly-badge-vip">VIP3</i>
                                -->
                            </a>
                            <span>#(x.createtime)</span>

                            <!--
                            <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>
                            <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
                            -->
                            <span class="fly-list-nums">
                                <i class="iconfont icon-pinglun1" title="回答"></i> #(x.replynum??0)
                            </span>
                        </div>
                        <div class="fly-list-badge">
                            #if(x.top >= 20)
                            <span class="layui-badge layui-bg-black">置顶</span>
                            #end
                            #if(x.wonderful >= 20)
                            <span class="layui-badge layui-bg-red">精帖</span>
                            #end
                        </div>
                    </li>
                    #else
                    <div class="fly-none">没有相关数据</div>
                    #end
                </ul>

                <div style="text-align: center">
                    <div id="jie-laypage" class=""> </div>
                </div>

            </div>
        </div>
        <div class="layui-col-md4">
            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">本周热帖</dt>
                #for(x : hotView.rows??)
                <dd>
                    <a href="/jie/detail/#(x.contentid)">#(x.title)</a>
                    <span><i class="iconfont icon-pinglun1"></i> #(x.viewnum)</span>
                </dd>
                #else
                <div class="fly-none">没有相关数据</div>
                #end
            </dl>

            #define x()
            <div class="fly-panel">
                <div class="fly-panel-title">
                    这里可作为广告区域
                </div>
                <div class="fly-panel-main">
                    <a href="" target="_blank" class="fly-zanzhu" style="background-color: #393D49;">虚席以待</a>
                </div>
            </div>

            <div class="fly-panel fly-link">
                <h3 class="fly-panel-title">友情链接</h3>
                <dl class="fly-panel-main">
                    <dd><a href="http://www.layui.com/" target="_blank">layui</a></dd>
                    <dd><a href="http://layim.layui.com/" target="_blank">WebIM</a></dd>
                    <dd><a href="http://layer.layui.com/" target="_blank">layer</a></dd>
                    <dd><a href="http://www.layui.com/laydate/" target="_blank">layDate</a></dd>
                    <dd>
                        <a href="mailto:xianxin@layui-inc.com?subject=%E7%94%B3%E8%AF%B7Fly%E7%A4%BE%E5%8C%BA%E5%8F%8B%E9%93%BE"
                           class="fly-link">申请友链</a>
                    </dd>
                </dl>
            </div>
            #end
        </div>
    </div>
</div>
#end

#define js()
<script>
    layui.cache.page = 'jie';
    layui.cache.total = parseInt('#(contents.total??0)');
    layui.cache.curr = parseInt('#(curr??1)');

    layui.cache.user = {
        username: '游客'
        , uid: -1
        , avatar: '../../res/images/avatar/00.jpg'
        , experience: 83
        , sex: '男'
    };
    layui.config({
        version: "2.0.0"
        , base: '../../res/mods/'
    }).extend({
        fly: 'index'
    }).use('fly');
</script>
#end